package gui;

import java.awt.Point;

import domain.Resource;
import factories.MapFactory;

import statics.Constants;

public class Map {

	public Point start;
	private Tile[][] map;
	
	public Map(){
		start = new Point(0,0);
		map = new Tile[Constants.map_x][Constants.map_y];
		for(int x = 0; x < map.length; x++)
			for(int y = 0; y < map[0].length; y++)
				map[x][y] = new Tile();
	}
	
	public Map(String fileName){
		start = new Point(0,0);
		map = MapFactory.loadMap(fileName);
	}
	
	public Tile getTile(int x, int y){
		return map[x][y];
	}
	
	public ForegroundType getResource(int x, int y){
		return map[x][y].ft;
	}
	
	public BackgroundType getBackground(int x, int y){
		return map[x][y].bt;
	}
	
}
